package com.wenhao.newcode.huawei.medium2016;

import java.util.Scanner;

/**
 * @author Wenhao Tong
 * @create 2021-07-21 13:47
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] matrix = new int[9][9];
        for (int i = 0;i < 9;i++) {
            for (int j = 0;j < 9;j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }
    }

    public boolean valid (int[][] matrix) {
        for (int i = 0;i < 9;i++) {
            boolean[] isExist1 = new boolean[9];
            boolean[] isExist2 = new boolean[9];
            for (int j = 0;j < 9;j++) {
                if (isExist1[matrix[i][j]]) {
                    return false;
                }
                if (!isExist1[matrix[i][j]]) {
                    isExist1[matrix[i][j]] = true;
                }
                if (isExist2[matrix[i][j]]) {
                    return false;
                }
                if (!isExist2[matrix[i][j]]) {
                    isExist2[matrix[i][j]] = true;
                }
            }
        }
        return false;
    }

    public static void dfs(int[][] matrix,int x,int y) {

    }
}
